//-------------------------报错提示--------------------
function Tips(data) {
	$("#myAlert").modal();
	$("#myAlert .modal-title").html("提示");
	$("#myAlert .modal-footer").html('<button type="button" class="btn btn-default" data-dismiss="modal">确定</button></div>');
	$("#myAlert .modal-body").html('<div class="simple-txt">' + data + '</div>');
}

//成功提示
function TipsSuccess(data) {    
	$("#successAlert").modal();
    var t = 2;  
    function showTime(){
        t -= 1;  
        //$('#second').html(t+1);  
        if(t==0){        
            $('#successAlert').modal('hide')
            return false;
        }  
       setTimeout(showTime,3000);
    }    
	$("#successAlert .modal-body").html('<div class="simple-txt">' + data + '</div>');
    showTime(); 
}

//---------------code报错配置-------------------
function errorCode(code, msg) {
	var error;
	switch (code) {
	case 400:
		window.location.href = C.domain+"/login/index";
		break;
    case 10004:
		error = "用户组名称已存在";
        break; 
    case 10029:
		error = "用户组创建失败";
		break;        
	case 120010:
		error = "当前访问的文件夹不存在";
		break;
	case 120125:
		error = "当前访问的文件夹不存在";
		break;
	case 120126:
		error = "文件名不合法";
		break;
	case 120314:
		error = "文件已存在";
		break;
	case 220402:
		error = "访问的分享不存在";
		break;
	case 220403:
		error = "无权访问";
		break;
	case 220404:
		error = "无权访问";
		break;
	case 120320:
		error = "未输入搜索关键词";
		break;
	case 130101:
		error = "访问的文件夹不存在，刷新再试";
		break;
	case 230101:
		error = "访问的文件夹不存在，刷新再试";
		break; 
	case 230113:
		error = "保存失败";
		break;        
	case 130103:
		error = "文件夹已存在";
		break;
	case 130105:
		error = "文件夹最多5级";
		break;
	case 130114:
		error = "文件夹已存在";
		break;
	case 240016:
		error = "访问的分享不存在，刷新再试";
		break;
	case 240019:
		error = "访问的分享不存在，刷新再试";
		break;
	case 240020:
		error = "密码错误";
		break;
	case 240021:
		error = "访问的分享不存在，刷新再试";
		break;
	case 240022:
		error = "密码错误";
		break;
	case 160103:
		error = "上传空间不足";
		break;


	case 180004:
		error = "上传空间不足";
		break;
	case 180006:
		error = "文件已存在";
		break;
	case 180009:
		error = "文件夹已存在";
		break;
	case 180010:
		error = "文件夹最多5级";
		break;
	case 180014:
		error = "上传空间不足";
		break;
	case 180015:
		error = "文件/文件夹不可移动到自身";
		break;
	case 180016:
		error = "文件/文件夹不可移动到自身";
		break;
	case 180017:
		error = "文件夹下最多1000个文件";
		break;
	case 180018:
		error = "文件/文件夹不可移动到其子文件夹";
		break;
	case 180019:
		error = "文件夹最多5级";
		break;
	case 170204:
		error = "当前IP不允许下载";
		break;
	case 170205:
		error = "当前操作超时";
		break;
	case 170105:
		error = "允许上传最大文件200M";
		break;
	case 170106:
		error = "上传文件太小";
		break;
	case 170114:
		error = "当前IP不允许下载";
		break;
	case 170115:
		error = "当前操作超时";
		break;
    case 10000:
		error = "系统错误";
		break;
    case 10001:
		error = "用户名必填";
		break;
    case 10002:
		error = "密码必填";
		break; 
    case 10003:
		error = "用户创建失败";
		break; 
    case 10008:
		error = "用户已存在";
		break;
    case 10009:
		error = "用户邮件发送失败";
		break;
    case 10010:
		error = "用户不存在";
		break;
    case 10011:
		error = "密码必填";
		break;
    case 10012:
		error = "新密码与旧密码不能相符";
		break;
    case 10013:
		error = "用户不存在";
		break; 
    case 10014:
		error = "用户存储失败";
		break;
    case 10015:
		error = "旧密码填写错误";
		break;
    case 10016:
		error = "用户组不存在";
		break;
    case 10017:
		error = "用户不存在";
		break;
    case 10018:
		error = "密码错误";
		break;
    case 10019:
		error = "用户组必填";
		break;
    case 10020:
		error = "用户未找到";
		break;
    case 10021:
		error = "用户初始化失败";
		break;
    case 10022:
		error = "用户组ID非法";
		break;
    case 10023:
		error = "创建用户组relation失败";
		break;
    case 10024:
		error = "用户组必填";
		break;
    case 10025:
		error = "用户未找到";
		break; 
    case 10026:
		error = "管理员用户不可修改";
		break; 
    case 10027:
		error = "用户更新失败";
		break; 
    case 10028:
		error = "用户组ID非法";
		break; 
    case 10029:
		error = "用户组创建失败";
		break; 
    case 120000:
		error = "未登录";
		break; 
    case 150000:
		error = "用户未找到";
		break;
    case 150001:
		error = "用户根目录未找到";
		break;         
    case 300001:
		error = "共享文件夹不存在";
		break; 
    case 300002:
		error = "没有权限";
		break;        
    case 300003:
		error = "没有共享文件夹的读权限";
		break;
    case 300004:
		error = "没有权限";
		break;
    case 300005:
		error = "没有权限";
		break; 
    case 250000:
		error = "用户未找到";
		break; 
    case 250001:
		error = "用户根目录未找到";
		break;
    case 280003:
		error = "用户未找到";
		break; 
    case 270005:
		error = "没权限";
		break; 
    case 270002:
		error = "文件夹ID必填";
		break; 
    case 270001:
		error = "授权信息写入失败";
		break;
    case 270002:
		error = "文件夹ID必填";
		break;
    case 270003:
		error = "出错：%s";
		break;
    case 270004:
		error = "文件夹ID不存在";
		break;
    case 270005:
		error = "没权限";
		break;
    case 270006:
		error = "文件夹ID必填";
		break;    
    case 270007:
		error = "没权限";
		break;
    case 270008:
		error = "授权信息写入失败";
		break;
    case 270009:
		error = "没权限";
		break;
    case 270010:
		error = "没权限";
		break;
    case 270011:
		error = "权限不能为空";
		break;
    case 270012:
		error = "文件ids传递错误";
		break;
    case 270013:
		error = "文件夹ids传递错误";
		break;        
    case 270014:
		error = "文件ID不存在";
		break;
    case 270015:
		error = "文件ID不存在";
		break; 
    case 270016:
		error = "文件夹ID不存在";
		break; 
    case 270017:
		error = "文件夹ID不存在";
		break; 
    case 270018:
		error = "文件ID不存在";
		break; 
    case 270019:
		error = "出错:%s";
		break;
    case 270020:
		error = "json数据未传递";
		break;
    case 270021:
		error = "json数据为空";
		break; 
    case 270022:
		error = "出错:%s";
		break;         
    case 270024:
		error = "保存失败";
		break;
    case 270025:
		error = "出错:%s";
		break;  
    case 270026:
		error = "出错:%s";
		break;  
    case 270027:
		error = "出错:%s";
		break;          
    case 270028:
		error = "没有权限";
		break;
    case 270029:
		error = "没有权限登录";
		break;        
    case 300001:
		error = "共享文件夹不存在，刷新再试";
		break;
    case 300002:
		error = "没权限";
		break;
    case 300003:
		error = "没有共享文件夹的读权限";
		break;
    case 300004:
		error = "没权限";
		break;
    case 300005:
		error = "没权限";
		break;
    case 190009:
		error = "文件夹已存在";
		break; 
    case 190014:
		error = "空间不足";
		break; 
    case 190004:
		error = "空间不足";
		break;
    case 190006:
		error = "文件已存在";
		break;
    case 190019:
		error = "文件夹最多5级";
		break;
    case 300001:
		error = "共享文件夹不存在，刷新再试";
		break;
    case 300002:
		error = "没权限";
		break;
    case 300003:
		error = "没有共享文件夹的读权限";
		break;  
    case 300004:
		error = "没权限";
		break;
    case 300005:
		error = "没权限";
		break; 
    case 290001:
		error = "未找到目标文件夹";
		break; 
    case 290006:
		error = "文件已存在";
		break; 
    case 290008:
		error = "未找到目标文件夹";
		break;    
    case 290009:
		error = "文件夹已存在";
		break;  

    case 290012:
		error = "未找到目标文件夹";
		break; 
    case 290012:
		error = "未找到目标文件夹";
		break; 
    case 290012:
		error = "未找到目标文件夹";
		break; 
    case 290012:
		error = "未找到目标文件夹";
		break; 
    case 290012:
		error = "未找到目标文件夹";
		break;
	case 230103:
		error = "文件夹已存在";
		break; 





case 10001: 	
error = "用户名必填";
break;
case 10002: 	
error = "密码必填";
break;
case 10003: 	
error = "用户创建失败";
break;
case 10008: 	
error = "用户已存在";
break;
case 10009: 	
error = "用户邮件发送失败";
break;
case 10010: 	
error = "用户不存在";
break;
case 10011: 	
error = "密码必填";
break;
case 10012: 	
error = "新密码与旧密码不能相符";
break;
case 10013: 	
error = "用户不存在";
break;
case 10014: 	
error = "用户存储失败";
break;
case 10015: 	
error = "旧密码填写错误";
break;
case 10016: 	
error = "用户组不存在";
break;
case 10017: 	
error = "用户不存在";
break;
case 10018: 	
error = "密码错误";
break;
case 10019: 	
error = "用户组必填";
break;
case 10020: 	
error = "用户未找到";
break;
case 10021: 	
error = "用户初始化失败";
break;
case 10022: 	
error = "用户组ID非法";
break;
case 10023: 	
error = "创建用户组relation失败";
break;
case 10024: 	
error = "用户组必填";
break;
case 10025: 	
error = "用户未找到";
break;
case 10026: 	
error = "管理员用户不可修改";
break;
case 10027: 	
error = "用户更新失败";
break;
case 10028: 	
error = "用户组ID非法";
break;
case 10029: 	
error = "用户组创建失败";
break;
case 10004: 	
error = "用户组名称已存在";
break;
case 10005: 	
error = "用户组不存在";
break;
case 10006: 	
error = "用户组更新失败";
break;
case 10007: 	
error = "用户组创建失败";
break;
case 120000: 	
error = "未登录";
break;
case 120126: 	
error = "name not allowed";
break;
case 120120: 	
error = "hash must be required";
break;
case 120121: 	
error = "hash must required";
break;
case 120122: 	
error = "init crypto faild,%s";
break;
case 120123: 	
error = "real_file not found";
break;
case 120125: 	
error = "current directory not found";
break;
case 120124: 	
error = "数据File写入失败";
break;
case 120128: 	
error = "数据FileUploadLog写入失败";
break;
case 120127: 	
error = "hash upload faild";
break;
case 120110: 	
error = "hash must required";
break;
case 120100: 	
error = "未找到";
break;
case 120500: 	
error = "文件夹ID必填";
break;
case 120501: 	
error = "文件名必填";
break;
case 120502: 	
error = "已存在文件%s";
break;
case 120312: 	
error = "当前文件不存在";
break;
case 120314: 	
error = "文件已存在";
break;
case 120313: 	
error = "保存失败";
break;
case 120503: 	
error = "init crypto faild,%s";
break;
case 120605: 	
error = "init crypto faild,%s";
break;
case 120400: 	
error = "ID必填";
break;
case 120401: 	
error = "文件不存在";
break;
case 120402: 	
error = "共享不存在";
break;
case 120403: 	
error = "没有下载权限";
break;
case 120404: 	
error = "没有下载权限";
break;
case 120320: 	
error = "搜索关键词必填";
break;
case 120310: 	
error = "%s";
break;
case 120201: 	
error = "%s";
break;
case 120200: 	
error = "%s";
break;
case 120010: 	
error = "文件夹不存在";
break;
case 120600: 	
error = "id必填";
break;
case 120601: 	
error = "文件不存在";
break;
case 120604: 	
error = "没有下载权限";
break;
case 130112: 	
error = "当前文件夹未找到";
break;
case 130114: 	
error = "文件夹已存在";
break;
case 130113: 	
error = "保存失败";
break;
case 130101: 	
error = "当前文件夹未找到";
break;
case 130102: 	
error = "操作失败，文件夹名不允许";
break;
case 130104: 	
error = "父文件夹未找到";
break;
case 130103: 	
error = "文件夹已存在";
break;
case 130105: 	
error = "文件夹最多%s级。";
break;
case 130106: 	
error = "操作失败";
break;
case 130115: 	
error = "回收站文件夹未找到";
break;
case 130116: 	
error = "删除文件夹未找到";
break;
case 130502: 	
error = "回收站未找到";
break;
case 130501: 	
error = "回收站未找到";
break;
case 130500: 	
error = "目标文件夹未找到";
break;
case 150000: 	
error = "用户未找到";
break;
case 150001: 	
error = "用户根目录未找到";
break;
case 180001: 	
error = "目标文件夹未找到";
break;
case 180005: 	
error = "目标文件未找到";
break;
case 180015: 	
error = "不允许移动/复制, 文件夹同名";
break;
case 180008: 	
error = "目标文件夹未找到";
break;
case 180016: 	
error = "不允许移动/复制, 文件夹同名";
break;
case 180002: 	
error = "说明没有dir、file，直接返回";
break;
case 180003: 	
error = "用户未找到";
break;
case 180017: 	
error = "文件夹已满";
break;
case 180006: 	
error = "文件已存在";
break;
case 180007: 	
error = "%s";
break;
case 180009: 	
error = "文件夹已存在";
break;
case 180018: 	
error = "当前文件夹不能移动到子文件夹";
break;
case 180010: 	
error = "深度不允许";
break;
case 180020: 	
error = "保存失败，请再试一次";
break;
case 180021: 	
error = "保存失败，请再试一次";
break;
case 180011: 	
error = "%s";
break;
case 180022: 	
error = "文件夹最多5级。";
break;
case 180012: 	
error = "目标文件夹未找到";
break;
case 180013: 	
error = "用户未找到";
break;
case 180014: 	
error = "空间不足";
break;
case 180004: 	
error = "空间不足";
break;
case 190001: 	
error = "目标文件夹未找到";
break;
case 190005: 	
error = "目标文件未找到";
break;
case 190015: 	
error = "不允许移动/复制，文件夹同名";
break;
case 190008: 	
error = "目标文件夹未找到";
break;
case 190016: 	
error = "不允许移动/复制，文件夹同名";
break;
case 190002: 	
error = "说明没有dir、file，直接返回";
break;
case 190003: 	
error = "用户未找到";
break;
case 190017: 	
error = "文件夹已满";
break;
case 190006: 	
error = "文件已存在";
break;
case 190007: 	
error = "%s";
break;
case 190009: 	
error = "文件夹已存在";
break;
case 190018: 	
error = "当前文件夹不能移动到子文件夹";
break;
case 190019: 	
error = "文件夹最多5级。";
break;
case 190010: 	
error = "深度不允许";
break;
case 190020: 	
error = "保存失败，请再试一次";
break;
case 190021: 	
error = "保存失败，请再试一次";
break;
case 190011: 	
error = "%s";
break;
case 190012: 	
error = "目标文件夹未找到";
break;
case 190013: 	
error = "用户未找到";
break;
case 190014: 	
error = "空间不足";
break;
case 160100: 	
error = "复制失败，未传递数据";
break;
case 160101: 	
error = "复制失败";
break;
case 160102: 	
error = "用户未找到";
break;
case 160109: 	
error = "文件夹已满";
break;
case 160104: 	
error = "当前文件夹未找到";
break;
case 160105: 	
error = "数据写入RealFile失败";
break;
case 160108: 	
error = "数据写入RealFile失败";
break;
case 160106: 	
error = "数据File写入失败";
break;
case 160111: 	
error = "数据FileUploadLog写入失败";
break;
case 160107: 	
error = "数据不符合规范";
break;
case 160112: 	
error = "文件ID必填";
break;
case 160113: 	
error = "文件未找到";
break;
case 160114: 	
error = "未找到RealFile";
break;
case 200000: 	
error = "操作错误：%s";
break;
case 220000: 	
error = "未登录";
break;
case 220126: 	
error = "名称非法";
break;
case 220120: 	
error = "hash must be required";
break;
case 220121: 	
error = "hash must required";
break;
case 220122: 	
error = "init crypto faild,%s";
break;
case 220123: 	
error = "real_file not found";
break;
case 220125: 	
error = "当前文件夹未找到";
break;
case 220124: 	
error = "数据File写入失败";
break;
case 220128: 	
error = "数据FileUploadLog写入失败";
break;
case 220127: 	
error = "hash upload faild";
break;
case 220110: 	
error = "hash must required";
break;
case 220100: 	
error = "未找到";
break;
case 220500: 	
error = "文件夹ID必填";
break;
case 220501: 	
error = "文件名必填";
break;
case 220502: 	
error = "已存在文件%s";
break;
case 220312: 	
error = "当前文件未找到";
break;
case 220314: 	
error = "文件已存在";
break;
case 220313: 	
error = "保存失败";
break;
case 220503: 	
error = "init crypto faild,%s";
break;
case 220605: 	
error = "init crypto faild,%s";
break;
case 220400: 	
error = "ID必填";
break;
case 220401: 	
error = "文件未找到";
break;
case 220402: 	
error = "共享未找到";
break;
case 220403: 	
error = "没有下载权限";
break;
case 220404: 	
error = "没有下载权限";
break;
case 220320: 	
error = "缺少搜索关键词";
break;
case 220310: 	
error = "%s";
break;
case 220201: 	
error = "%s";
break;
case 220200: 	
error = "取列表失败：%s";
break;
case 220010: 	
error = "文件夹未找到";
break;
case 220600: 	
error = "ID必填";
break;
case 220601: 	
error = "文件未找到";
break;
case 220604: 	
error = "没有下载权限";
break;
case 230112: 	
error = "当前文件夹未找到";
break;
case 230114: 	
error = "文件夹已存在";
break;
case 230113: 	
error = "保存失败";
break;
case 230101: 	
error = "当前文件夹未找到";
break;
case 230102: 	
error = "操作失败，文件夹名不允许";
break;
case 230104: 	
error = "父文件夹未找到";
break;
case 230103: 	
error = "文件夹已存在";
break;
case 230105: 	
error = "文件夹最多%s级。";
break;
case 230106: 	
error = "insert faild,message:%s";
break;
case 230115: 	
error = "回收站文件夹未找到";
break;
case 230116: 	
error = "删除文件夹未找到";
break;
case 230502: 	
error = "回收站未找到";
break;
case 230501: 	
error = "回收站未找到";
break;
case 230500: 	
error = "目标文件夹未找到";
break;
case 250000: 	
error = "用户未找到";
break;
case 250001: 	
error = "用户根目录未找到";
break;
case 280001: 	
error = "目标文件夹未找到";
break;
case 280005: 	
error = "目标文件未找到";
break;
case 280015: 	
error = "不允许移动/复制，文件夹同名";
break;
case 280008: 	
error = "目标文件夹未找到";
break;
case 280016: 	
error = "不允许移动/复制，文件夹同名";
break;
case 280002: 	
error = "说明没有dir、file，直接返回";
break;
case 280003: 	
error = "用户未找到";
break;
case 280017: 	
error = "文件夹已满";
break;
case 280006: 	
error = "文件已存在";
break;
case 280007: 	
error = "%s";
break;
case 280009: 	
error = "文件夹已存在";
break;
case 280018: 	
error = "当前文件夹不能移动到子文件夹";
break;
case 280019: 	
error = "文件夹最多*级。";
break;
case 280010: 	
error = "深度不允许";
break;
case 280020: 	
error = "保存失败，请再试一次";
break;
case 280021: 	
error = "保存失败，请再试一次";
break;
case 280011: 	
error = "%s";
break;
case 280012: 	
error = "目标文件夹未找到";
break;
case 280013: 	
error = "用户未找到";
break;
case 280014: 	
error = "空间不足";
break;
case 280004: 	
error = "空间不足";
break;
case 280025: 	
error = "没有写权限";
break;
case 280022: 	
error = "文件ids非法";
break;
case 280023: 	
error = "文件夹ids非法";
break;
case 280026: 	
error = "文件ID必填";
break;
case 280027: 	
error = "文件未找到";
break;
case 280028: 	
error = "没有权限";
break;
case 280029: 	
error = "未找到RealFile";
break;
case 270001: 	
error = "授权信息写入失败";
break;
case 270002: 	
error = "文件夹ID必填";
break;
case 270003: 	
error = "出错：%s";
break;
case 270004: 	
error = "文件夹ID不存在";
break;
case 270005: 	
error = "没权限";
break;
case 270006: 	
error = "dir_id 必填";
break;
case 270007: 	
error = "没权限";
break;
case 270008: 	
error = "授权信息写入失败";
break;
case 270009: 	
error = "没权限";
break;
case 270010: 	
error = "没权限";
break;
case 270011: 	
error = "权限不能为空";
break;
case 270012: 	
error = "文件ids传递错误";
break;
case 270013: 	
error = "文件夹ids传递错误";
break;
case 270014: 	
error = "文件ID不存在";
break;
case 270015: 	
error = "文件ID不存在";
break;
case 270016: 	
error = "文件夹ID不存在";
break;
case 270017: 	
error = "文件夹ID不存在";
break;
case 270018: 	
error = "文件ID不存在";
break;
case 270019: 	
error = "出错:%s";
break;
case 270020: 	
error = "json数据未传递";
break;
case 270021: 	
error = "json数据为空";
break;
case 270022: 	
error = "出错:%s";
break;
case 270024: 	
error = "保存失败";
break;
case 270025: 	
error = "出错:%s";
break;
case 270026: 	
error = "出错:%s";
break;
case 270027: 	
error = "出错:%s";
break;
case 270028: 	
error = "没有权限";
break;
case 270029: 	
error = "没有权限登录";
break;
case 290001: 	
error = "目标文件夹未找到";
break;
case 290005: 	
error = "目标文件未找到";
break;
case 290020: 	
error = "保存失败，请再试一次";
break;
case 290021: 	
error = "保存失败，请再试一次";
break;

	default:
		error = '系统繁忙，请稍后再试 ['+code+']';
	}
	Tips(msg)
}
